home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14621 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: ix.netcom.com!news
  2. From: jlilley@ix.netcom.com (John Lilley)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: dynamic binding in C++
  5. Date: 1 Apr 1996 00:06:50 GMT
  6. Organization: Netcom
  7. Message-ID: <4jn6mq$sls@dfw-ixnews1.ix.netcom.com>
  8. References: <4j9dq7$4f@larch.cc.swarthmore.edu> <315C871E.22F8@aai.arco.com>
  9. NNTP-Posting-Host: den-co16-05.ix.netcom.com
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-NETCOM-Date: Sun Mar 31  6:06:50 PM CST 1996
  13. X-Newsreader: WinVN 0.99.7
  14.  
  15. In article <315C871E.22F8@aai.arco.com>, lasbfl@aai.arco.com says...
  16.  
  17. >>Mark Tong '99 wrote:
  18. >> Anybody knows whether C++ is capable of dynamic binding?
  19.  
  20. >It is possible, but I believe it is implementation dependent.
  21. >I have not done it myself, but I have seen a massive manual
  22. >from IBM for their AIX systems which explains how to do it
  23. >on their systems.
  24.  
  25. Dynamic *loading* (i.e., binding an entire class by name at runtime), if 
  26. that's what you mean, can be done with a DLL on Windows 95/NT.  It's pretty 
  27. much just a matter of writing a class, making all of the methods that you care 
  28. about virtual, and then exporting two "C" functions that create and destroy 
  29. the objects by pointer.  Then you load the "C" functions by name from the DLL 
  30. at runtime.  Call the "C" create function by pointer to create an object.  
  31. Once you have a pointer to an object, all the the virtual methods work 
  32. automatically.  Of course, you cannot make them automatic variables, but that 
  33. is the case with most dynamic binding.
  34.  
  35. john lilley
  36.  
  37.